﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace CustomsDocumentOA.Project.Migrations
{
    public partial class create_entity : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreatTime",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "CustomerId",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "IsDelete",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "RecordId",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "UpdateTime",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "WorkOrderName",
                table: "CDOA_Visit_Record");

            migrationBuilder.AlterColumn<long>(
                name: "UserId",
                table: "CDOA_Visit_Record",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.AddColumn<DateTime>(
                name: "CreationTime",
                table: "CDOA_Visit_Record",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<long>(
                name: "CreatorUserId",
                table: "CDOA_Visit_Record",
                nullable: true);

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "CDOA_Visit_Record",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<DateTime>(
                name: "LastModificationTime",
                table: "CDOA_Visit_Record",
                nullable: true);

            migrationBuilder.AddColumn<long>(
                name: "LastModifierUserId",
                table: "CDOA_Visit_Record",
                nullable: true);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "CreationTime",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "CreatorUserId",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "LastModificationTime",
                table: "CDOA_Visit_Record");

            migrationBuilder.DropColumn(
                name: "LastModifierUserId",
                table: "CDOA_Visit_Record");

            migrationBuilder.AlterColumn<int>(
                name: "UserId",
                table: "CDOA_Visit_Record",
                type: "int",
                nullable: false,
                oldClrType: typeof(long));

            migrationBuilder.AddColumn<DateTime>(
                name: "CreatTime",
                table: "CDOA_Visit_Record",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<int>(
                name: "CustomerId",
                table: "CDOA_Visit_Record",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<int>(
                name: "IsDelete",
                table: "CDOA_Visit_Record",
                type: "int",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<Guid>(
                name: "RecordId",
                table: "CDOA_Visit_Record",
                type: "uniqueidentifier",
                nullable: false,
                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateTime",
                table: "CDOA_Visit_Record",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<string>(
                name: "WorkOrderName",
                table: "CDOA_Visit_Record",
                type: "nvarchar(max)",
                nullable: true);
        }
    }
}
